###
#Content Analysis of Fox News mentions of ESPN
###

library(plyr)
load(file='foxnews.espn.coverage.RData')

#Agreement rate between authors in assessing coverage
mean(foxnews.espn.coverage$agreement,na.rm=TRUE)

#Distribution of coverage by topic
table(foxnews.espn.coverage$category)/128

sports.out <- ddply(foxnews.espn.coverage,.(year),summarise,total=length(final.label),espn.stories=sum(final.label,na.rm=TRUE))
sports.out$political.share <- sports.out$espn.stories/sports.out$total

pdf(file='figure1.pdf',height=4,width=6)
par(mar=c(4,4,1,1))
plot(x=sports.out$year,y=sports.out$espn.stories,las=1,type='p',xlab='Year',ylab="Number of Shows with Mention",pch=16,ylim=c(0,55),cex=1.5)
lines(x=sports.out$year,y=sports.out$espn.stories,lty=2,lwd=2)
dev.off()
